<#--接口加密模块-->
<#if charListReqId??>
    <#list charListReqId as char>
var t_req_${char?index}='${char}';
    <#--混淆部分-->
        <#if char?index gte 0 >
            <#list charListReqId as nestedItem>
var t_req_${char?index}_${nestedItem?index}='${nestedItem}';
            </#list>
        </#if>
    </#list>
</#if>
<#--秘钥-->
<#list charListSecretKey as char>
 var t_char_${char?index}='${char}';
<#--混淆部分-->
 <#if char?index gte 0 >
     <#list charListSecretKey as nestedItem>
var t_char_${char?index}_${nestedItem?index}='${nestedItem}';
     </#list>
 </#if>
</#list>

<#--自动执行-->
document.addEventListener("DOMContentLoaded", function() {
    console.log('开始设置了');
    var userToken=localStorage.getItem('user_token')
    var s=secrypt_t_mode.getEncrypt(userToken).toString();
    console.log(s);
})

<#if charListSessionId??>
<#--会话-->
<#list charListSessionId as char>
var t_cha_${char?index}='${char}';
<#--混淆部分-->
<#if char?index gte 0 >
    <#list charListSessionId as nestedItem>
var t_cha_${char?index}_${nestedItem?index}='${nestedItem}';
    </#list>
</#if>
</#list>
</#if>
var secrypt_t_mode={
    initCookie:function(){
        var userToken=localStorage.getItem('sessionId')
        let sessionId=this.getReqId_t();
        var token_str=secrypt_t_mode.getEncrypt(userToken).toString();
        CookieUtil.set("sessionId", sessionId);
    },
    getsecryptkey:function(){
        let sk=this.get_seck_t();
        return CryptoJS.enc.Utf8.parse(sk);
    },
<#--  加密-->
    getEncrypt:function(plaintText){
        let secryptkey=this.getsecryptkey();
        return CryptoJS.AES.encrypt(plaintText, secryptkey, {
            mode: CryptoJS.mode.ECB,
            padding: CryptoJS.pad.Pkcs7
        });
    },
<#--reqId-->
<#if insertedIndicesReqId??>
    getReqId_l:function(){
        return this.getCharReqStr_${insertedIndicesReqId?size - 1}();
    },
    getReqId_t:function(){
        let s=this.getReqId_l();
        return this.decodeStr(s);
    },
<#list insertedIndicesReqId as item>
    getCharReqStr_${item?index}:function(){
    <#if item?index == 0>
        return t_req_${item};
    <#else>
        return this.getCharReqStr_${item?index - 1}()+ t_req_${item};
    </#if>
    },
<#--    混淆部分 -->
    <#if item?index gte 0 >
        <#list insertedIndicesReqId as nestedItem>
    getCharReqStr_${item?index}_${nestedItem?index}:function(){
            return this.getCharReqStr_${nestedItem?index - 1}()+ t_req_${nestedItem};
    },
        </#list>
    </#if>
</#list>
</#if>
    decodeStr:function(v){
        return decodeURIComponent(escape(atob(v)));
    },
<#--秘钥-->
<#list insertedIndicesSecretKey as item>
    getCharStr_${item?index}:function(){
    <#if item?index == 0>
        return t_char_${item};
    <#else>
        return this.getCharStr_${item?index - 1}()+ t_char_${item};
    </#if>
    },
<#--    混淆部分 -->
<#if item?index gte 0 >
    <#list insertedIndicesSecretKey as nestedItem>
        getCharStr_${item?index}_${nestedItem?index}:function(){
            return this.getCharStr_${nestedItem?index - 1}()+ t_char_${nestedItem};
        },
    </#list>
</#if>
</#list>

<#--会话id-->
<#if insertedIndicesSessionId??>
<#list insertedIndicesSessionId as item>
    getSCharStr_${item?index}:function(){
    <#if item?index == 0>
        return t_cha_${item};
    <#else>
        return this.getSCharStr_${item?index - 1}()+ t_cha_${item};
    </#if>
    },
<#--    混淆部分-->
<#if item?index gte 0 >
    <#list insertedIndicesSessionId as nestedItem>
    getSCharStr_${item?index}_${nestedItem?index}:function(){
         return this.getSCharStr_${nestedItem?index - 1}()+ t_char_${nestedItem};
    },
    </#list>
</#if>
</#list>
</#if>
    get_seck:function(){
        return this.getCharStr_${insertedIndicesSecretKey?size - 1}();
    },
    get_seck_t:function(){
       let s=this.get_seck();
        return this.decodeStr(s);
    },
<#if insertedIndicesSessionId??>
    getse_ky_t:function(){
        return this.getSCharStr_${insertedIndicesSessionId?size - 1}();
    },
    gets_ky:function(){
        let s=this.getse_ky_t();
        return this.decodeStr(s);
    },
</#if>
<#--加密请求-->
}
